<?php
App::uses('AppModel', 'Model');
/**
 * Quiz Model
 *
 * @property QuizView $QuizView
 * @property StudyLevel $StudyLevel
 * @property Lesson $Lesson
 * @property Subject $Subject
 * @property Question $Question
 * @property QuestionsGroup $QuestionsGroup
 */
class Quiz extends AppModel {

/**
 * Display field
 *
 * @var string
 */
	public $displayField = 'title';


	//The Associations below have been created with all possible keys, those that are not needed can be removed

/**
 * hasOne associations
 *
 * @var array
 */
	public $hasOne = array(
		'QuizView' => array(
			'className' => 'QuizView',
			'foreignKey' => 'quiz_id',
		)
	);

/**
 * belongsTo associations
 *
 * @var array
 */
	public $belongsTo = array(
		'StudyLevel' => array(
			'className' => 'StudyLevel',
			'foreignKey' => 'study_level_id'
		),
		'Lesson' => array(
			'className' => 'Lesson',
			'foreignKey' => 'lesson_id'
		),
		'Subject' => array(
			'className' => 'Subject',
			'foreignKey'=> 'subject_id',
		)
	);

/**
 * hasMany associations
 *
 * @var array
 */
	public $hasMany = array(
		'Question' => array(
			'className' => 'Question',
			'foreignKey' => 'quiz_id',
			'dependent' => false
		),
		'QuestionGroup' => array(
			'className' => 'QuestionGroup',
			'foreignKey' => 'quiz_id',
			'dependent' => false
		)
	);

}
